home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Snippets / Development Tools & Languages / DTSCPlusLibrary / Sources / EnvironmentTest.cp < prev    next >
Encoding:
Text File  |  1993-01-14  |  2.1 KB  |  74 lines  |  [TEXT/MPS ]

  1. /* _________________________________________________________________________________________________________ //
  2.   Copyright © 1992 Apple Computer, Inc. All rights reserved.
  3.   Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
  4.   Programmer: Kent Sandvik
  5.   Date: 11/9/92
  6.   Revision comments are at the end of this file.
  7.   ---
  8.   TEnvironment is a Gestalt wrapper class that finds out information about the environment.
  9.   EnvironmentTest.h contains the test functions for the TEnvironment class.
  10.   _________________________________________________________________________________________________________ */
  11.  
  12. // INCLUDES
  13. #ifndef _ENVIRONMENT_
  14. #include "Environment.h"
  15. #endif
  16.  
  17. //    This test will check out the functions of the TEnvironment class. We assume that
  18. //  we are running on a fairly typical System 7.0.1/7.1 system.
  19.  
  20. void main(void)
  21.  
  22. {
  23.     cout << "Start of TEnvironment test…\n";
  24.     TEnvironment myEnvironment;
  25.  
  26.     //    128k TEST    
  27.     if (myEnvironment.Check128k())
  28.         cout << "We have a 128 or better system.\n";
  29.     else
  30.         cout << "We have an ancient Mac…\n";
  31.  
  32.     //    APPLEEVENTS TEST
  33.     if (myEnvironment.HasAppleEvents())
  34.         cout << "We have Apple Events.\n";
  35.     else
  36.         cout << "We don't have Apple Events.\n";
  37.  
  38.  
  39.     //    COLOR QUICKDRAW TEST
  40.     if (myEnvironment.HasColorQD())
  41.         cout << "We have Color Quickdraw.\n";
  42.     else
  43.         cout << "We don't have Color Quickdraw.\n";
  44.  
  45.     //  IS SYSTEM 7?
  46.     if (myEnvironment.IsSystemSeven())
  47.         cout << "We are running under System 7.\n";
  48.     else
  49.         cout << "We are NOT running under System 7.\n";
  50.  
  51.     //     TEST GENERIC ATTRIBUTE
  52.     if (myEnvironment.HasAttribute(gestaltFontMgrAttr, gestaltOutlineFonts))
  53.         cout << "We have TrueType font support.\n";
  54.     else
  55.         cout << "We DON'T have TrueType font support.\n";
  56.  
  57.  
  58.     //    CHECK IF THE X TRAP IS AVAILABLE
  59.     if (myEnvironment.TrapAvailable(OSTrap, 0xA82A))// Component Manager
  60.         cout << "We have _ComponentDispatch.\n";
  61.     else
  62.         cout << "We don't have _ComponentDispatch.\n";
  63.  
  64.  
  65.     cout << "End of TEnvironment test!\n";
  66. }
  67.  
  68. // _________________________________________________________________________________________________________ //
  69.  
  70. /*    Change History (most recent last):
  71.   No        Init.    Date        Comment
  72.   1            khs        11/9/92        New file
  73. */
  74.